<?

define('PATH_TEMP', '/data/temp');

	ob_start();

	print_r($_POST);
	print_r($_FILES);

	if (isset( $_POST['resource'] ) ) {

		$id = $_POST['resource']['tmpidvideo'];

		// echo $_POST['resource']['tmpidvideo'].", ".$_FILES['resource']['tmp_name']['file'];

		// something has been uploaded without error ? (we just check the first uploaded file)
		if ( 	(isset($_POST['resource']['tmpidvideo'])) &&
			(isset($_FILES)) && (isset($_FILES['resource'])) && 
			(@count($_FILES['resource']['error'][0]['file'])==0) 
			&& (is_uploaded_file($_FILES['resource']['tmp_name']['file']))
		) {
			echo "move ".$_FILES['resource']['tmp_name']['file']." -> ".  PATH_TEMP.'/'. $id ."\n";
			if (move_uploaded_file(  $_FILES['resource']['tmp_name']['file'] , PATH_TEMP.'/'. $id )) {
				echo "ok";
			}
		}
	}


	$f = fopen("post.txt", "w+");
	fputs($f, ob_get_clean() );
	fclose($f);


?>
